<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>v-show</title>
</head>
<!-- v-show是切换元素的显示状态 -->
<!-- 最终都会将里面的值转换成一个bool类型的值 -->

<body>

    <div id="app">
        <img v-show="vshow" src="https://img0.baidu.com/it/u=1285092219,604874933&fm=253&fmt=auto&app=138&f=PNG?w=889&h=500" alt="">
        <button @click="changedis">点击显示</button>
        <img v-show="age>=12" src="https://img0.baidu.com/it/u=1285092219,604874933&fm=253&fmt=auto&app=138&f=PNG?w=889&h=500" alt="">
        <button @click="addage">年龄</button>
    </div>
</body>
<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
<script>
    var app = new Vue({
        el: "#app",
        data: {
            vshow: false,
            age: 11
        },
        methods: {
            changedis: function() {
                this.vshow = !this.vshow;
            },
            addage: function() {
                this.age++;
            }

        }
    })
</script>

</html>